<?php
	require_once ("ClassAdmin.php");
	$obj=new admin();
	$listNews=$obj->ListSubCat();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#wrap{ margin:0px; padding:0px;}
form{ width:800px; margin:40px auto; min-height:300px;}
h4{float:left;width:16%;border:#222222 1px solid; margin:0px; text-align:center;}
.clear{ clear:both;}
#content div{float:left; width:16%;border:#222222 1px solid;}
</style>
</head>

<body>
	<div id="wrap">
    	<form id="form1" name="form1" action="" method="post">
        	<div id="ListSubCat">
            	<div id="header">
                	<h4>idLT</h4>
                    <h4>Tên loại tin</h4>
                    <h4>Ẩn hiện</h4>
                    <h4>Thứ tự</h4>
                    <h4>Thể loại</h4>
                    <h4>Action</h4>
                </div><!--End #header-->
                <?php while($row_listNews=mysql_fetch_assoc($listNews)){?>
                <?php ob_start();?>
                <div id="content">
                	<div>{idLT}</div>
                    <div>{Ten}</div>
                    <div>{AnHien}</div>
                    <div>{ThuTu}</div>
                    <div>{TenTL}</div>
                    <div>
                    	<a href="subCatUpdate.php?idLT={idLT}">Update</a>
                        <a href="DelSubCat.php?idLT={idLT}" onclick=" return confirm('Delete?');">Xóa</a>
                    </div>
                </div><!-- End #content-->	   
				<?php 
                    $str=ob_get_clean();
                    $str=str_replace("{idLT}",$row_listNews['idLT'],$str);
                    $str=str_replace("{Ten}",$row_listNews['Ten'],$str);
                    $str=str_replace("{AnHien}",($row_listNews['AnHien']==1)? "Đang hiện" : "Đang ẩn",$str);
                    $str=str_replace("{ThuTu}",$row_listNews['ThuTu'],$str);
                    $str=str_replace("{TenTL}",$row_listNews['TenTL'],$str);
                    
                    echo $str;
                ?><!-- End ob_start(); -->
                <?php }?> <!--End while -->
        	</div><!--End #ListSubCat -->
        </form> 
    </div>
</body>
</html>